#pragma once
// ok, I really hate c++ right about now. . .
class View;

struct Vertex
{
	// Position of vertex in 3D space
	float x, y, z; 
	// Color of vertex
    DWORD color;   
};

// TODO:  would be cool if these could form a tree-like structure so that
// you could stack renderables easily for stuff like shields, invisibility, 
// etc.  Maybe in the next version when I learn more about graphics libraries.
class IRenderable
{
public:
	IRenderable(void);
	virtual ~IRenderable(void);

	// things to do prior to rendering
	virtual void PreRender(View* view) = 0;

	// the view has things like the sprite and dd3dobject stuff in it that 
	// this can use to render stuff
	virtual void Render(View* view) = 0;

	// things to do after rendering, like restoring state if necessary
	virtual void PostRender(View* view) = 0;

	// GameObject that owns this thing
	virtual void SetOwner(GameObject* value);

	// object's position in world space (used for world transform.  that's right, I said world transform.
	// someone's been reading about 3D graphics)	
	virtual void SetPosition(float xValue, float yValue);

	// sets this object's rotation.  Rotation value should be between 0 and 2*PI
	virtual void SetRotation(float rotationValue);

	// get current position of this game object
	virtual float PositionX();
	virtual float PositionY();

	// calculate center of this sprite
	// TODO:  probably could eliminate this
	virtual D3DXVECTOR3 GetCenter();
	
protected: 
	GameObject* owner;
	float positionX, positionY, rotation;
};

